﻿/*========================== 
 * @author 郑金泉
 * @desc 实体接口
 * ========================= */
using System;
using System.Collections.Generic;
using System.Text;
using Obsidian.Data.Sql;

namespace Obsidian.Edm
{
    public interface IModel
    {
        string DbAlias { get; }

        string DbTableName { get; }

        DataBase GetDataBase();

        DbTable GetDbTable();

        IModelField[] Fields { get; }

        IModelField PimaryKey { get; }

        IModelField GetFieldByQueryAlias(string queryAlias);

        IModelField GetFieldByAlias(string alias);

        IDbHandler CreateHandler();

        IModel SetTo(IModel targetModel, string fieldAliases);

        void ResetAssigned();

        bool GetByPrimaryKey(object pkValue);

        void Save();

        bool Update();

        bool Delete();

        bool Exists(params object[] pkValues);
    }
}
